package cn.kgc.mes.service.impl;

import java.util.List;
import cn.kgc.mes.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.kgc.mes.mapper.RepairLineMapper;
import cn.kgc.mes.domain.RepairLine;
import cn.kgc.mes.service.IRepairLineService;

/**
 * 设备维修单行Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-16
 */
@Service
public class RepairLineServiceImpl implements IRepairLineService 
{
    @Autowired
    private RepairLineMapper repairLineMapper;

    /**
     * 查询设备维修单行
     * 
     * @param lineId 设备维修单行主键
     * @return 设备维修单行
     */
    @Override
    public RepairLine selectRepairLineByLineId(Long lineId)
    {
        return repairLineMapper.selectRepairLineByLineId(lineId);
    }

    /**
     * 查询设备维修单行列表
     * 
     * @param repairLine 设备维修单行
     * @return 设备维修单行
     */
    @Override
    public List<RepairLine> selectRepairLineList(RepairLine repairLine)
    {
        return repairLineMapper.selectRepairLineList(repairLine);
    }

    /**
     * 新增设备维修单行
     * 
     * @param repairLine 设备维修单行
     * @return 结果
     */
    @Override
    public int insertRepairLine(RepairLine repairLine)
    {
        repairLine.setCreateTime(DateUtils.getNowDate());
        return repairLineMapper.insertRepairLine(repairLine);
    }

    /**
     * 修改设备维修单行
     * 
     * @param repairLine 设备维修单行
     * @return 结果
     */
    @Override
    public int updateRepairLine(RepairLine repairLine)
    {
        repairLine.setUpdateTime(DateUtils.getNowDate());
        return repairLineMapper.updateRepairLine(repairLine);
    }

    /**
     * 批量删除设备维修单行
     * 
     * @param lineIds 需要删除的设备维修单行主键
     * @return 结果
     */
    @Override
    public int deleteRepairLineByLineIds(Long[] lineIds)
    {
        return repairLineMapper.deleteRepairLineByLineIds(lineIds);
    }

    /**
     * 删除设备维修单行信息
     * 
     * @param lineId 设备维修单行主键
     * @return 结果
     */
    @Override
    public int deleteRepairLineByLineId(Long lineId)
    {
        return repairLineMapper.deleteRepairLineByLineId(lineId);
    }
}
